from jump_king.lib.ssh_interactive import Ssh_handler
class Handler(object):
    def __init__(self,argv):
        self.argv=argv

    def help_msg(self,msg=None):
        message='%s'%msg
        exit(message)

    def run(self):
        start=Ssh_handler()
        start.host_list()

    def call(self):
        if len(self.argv) == 1:
            self.help_msg('ERROR   必须输入一个参数')
        if hasattr(self,self.argv[1]):
            getattr(self,self.argv[1])()
        else:
            self.help_msg('输入的参数不存在')